import { commonRequest } from '@/api/commonHttp';

// 原材料管理 - 列表查询
export const queryMaterialListService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterial/queryRawMaterialList',
  type: 'post',
  data,
  loadingFn
});
// 原材料管理 - 详情查询
export const queryMaterialDetailService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterial/queryRawMaterialListById',
  type: 'post',
  data,
  loadingFn
});
// 原材料管理 - 新增
export const addMaterialService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterial/saveRawMaterialList',
  type: 'post',
  data,
  loadingFn
});
// 原材料管理 - 修改
export const updateMaterialService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterial/modifyRawMaterialList',
  type: 'post',
  data,
  loadingFn
});

// 原材料管理 - 价格走势图
export const queryMaterialPriceChartService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterialPriceChangeHistory/echartsData',
  type: 'post',
  data,
  loadingFn
});

// 原材料管理 - 价格走势记录
export const queryMaterialPriceChartLogService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterialPriceChangeHistory/list',
  type: 'post',
  data,
  loadingFn
});

// 原材料管理 - 导出变价记录
export const exportMaterialPriceChartLogService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterialPriceChangeHistory/exportExcel',
  type: 'post',
  data,
  loadingFn,
  isExport: true
});

// 原材料管理 - 导出关联品类
export const exportMaterialLinkCategoryService = (data, loadingFn) => commonRequest({
  url: '/sysback/product/rawMaterial/exportCategoryRel',
  type: 'post',
  data,
  loadingFn,
  isExport: true
});
